// #ifndef VUE3
import Vue from 'vue'
import App from './App'

import store from "./store"
import axios from "./axios"

Vue.config.productionTip = false
Vue.prototype.axios = axios;
Vue.prototype.$store = store;

// #ifdef APP-PLUS
Vue.prototype.$XFModule = uni.requireNativePlugin('XF-floatView');
Vue.prototype.$type5Flag = false; //为true时不因type5而展示锁屏悬浮窗
// #endif

Vue.prototype.showLoading = function(title = "") {
	uni.showLoading({
		title,
		mask: true
	});
}
Vue.prototype.hideLoading = function() {
	uni.hideLoading();
}

Vue.prototype.previewImage = function(url) {
	// #ifdef APP-PLUS
	Vue.prototype.$type5Flag = true;
	// #endif
	if (url instanceof Array) {
		uni.previewImage({
			urls: url,
			background:"#FFFFFF"
		})
	} else {
		uni.previewImage({
			urls: [url],
			background:"#FFFFFF"
		})
	}
}

Vue.prototype.getChoiceIndex = function(index) { //生成ABCD等序号
	try {
		index = Number(index);
		return String.fromCharCode(64 + parseInt(index + 1))
	} catch (e) {
		return null
	}
}


App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
import App from './App.vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif


//生产环境去除console.log
if (process.env.NODE_ENV == 'production') {
	console.log = () => {}
}